page.tsx 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import Link from "next/link";
  2. import { auth } from "~/server/auth";
  3. import { db } from "~/server/db";
  4. import { Bell } from "lucide-react";
  5. import {
  6. Card,
  7. CardDescription,
  8. CardHeader,
  9. CardTitle,
  10. } from "~/components/ui/card";
  11. /**
  12. * Centre de notifications in-app, complément aux emails envoyés aux transformateurs.
  13. */
  14. export default async function NotificationsPage({
  15. params,
  16. }: {
  17. params: Promise<{ workspaceId: string }>;
  18. }) {
  19. const { workspaceId } = await params;
  20. const session = await auth();
  21. if (!session?.user?.id) {
  22. return null;
  23. }
  24. const workspace = await db.workspace.findFirst({
  25. where: {
  26. id: workspaceId,
  27. ownerId: session.user.id,
  28. },
  29. select: { id: true },
  30. });
  31. if (!workspace) {
  32. return (
  33. <main className="flex min-h-[40vh] flex-col items-center justify-center p-4">
  34. <p className="text-destructive">Workspace non trouvé</p>
  35. <Link href="/" className="mt-4 text-primary underline">
  36. Retour
  37. </Link>
  38. </main>
  39. );
  40. }
  41. return (
  42. <main className="mx-auto max-w-lg p-4 pb-16 pt-6 sm:p-6">
  43. <div className="mb-6 flex items-center gap-3">
  44. <div className="flex size-11 items-center justify-center rounded-xl bg-primary/10">
  45. <Bell className="size-5 text-primary" aria-hidden />
  46. </div>
  47. <div>
  48. <h1 className="text-lg font-semibold tracking-tight">
  49. Notifications
  50. </h1>
  51. <p className="text-sm text-muted-foreground">
  52. Historique des alertes dans l&apos;application.
  53. </p>
  54. </div>
  55. </div>
  56. <Card>
  57. <CardHeader>
  58. <CardTitle>Aucune alerte locale pour le moment</CardTitle>
  59. <CardDescription>
  60. Les emails (nouvelle idée, réponses qualification, etc.) continuent d&apos;
  61. être envoyés selon votre configuration. Une liste dans l&apos;app sera ajoutée
  62. prochainement. Le résumé des nouvelles idées et réponses s&apos;
  63. affiche aussi sur votre backlog.
  64. </CardDescription>
  65. </CardHeader>
  66. </Card>
  67. <p className="mt-6 text-center text-sm">
  68. <Link
  69. href={`/workspace/${workspaceId}/backlog`}
  70. className="text-primary underline-offset-4 hover:underline"
  71. >
  72. Ouvrir le backlog
  73. </Link>
  74. </p>
  75. </main>
  76. );
  77. }